/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package model.pojo;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Yasith
 */
@Entity
@Table(name = "adds")
@NamedQueries({@NamedQuery(name = "Add.findByAddId", query = "SELECT a FROM Add a WHERE a.addId = :addId"), @NamedQuery(name = "Add.findByAddText", query = "SELECT a FROM Add a WHERE a.addText = :addText"), @NamedQuery(name = "Add.findByAddLink", query = "SELECT a FROM Add a WHERE a.addLink = :addLink"), @NamedQuery(name = "Add.findByAddStatus", query = "SELECT a FROM Add a WHERE a.addStatus = :addStatus"), @NamedQuery(name = "Add.findByHitCounter", query = "SELECT a FROM Add a WHERE a.hitCounter = :hitCounter"), @NamedQuery(name = "Add.findByTimestamp", query = "SELECT a FROM Add a WHERE a.timestamp = :timestamp")})
public class Add implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue
    @Column(name = "addId", nullable = false)
    private Integer addId;
    @Column(name = "addText")
    private String addText;
    @Column(name = "addLink")
    private String addLink;
    @Column(name = "addStatus")
    private Boolean addStatus;
    @Column(name = "hitCounter")
    private Integer hitCounter;
    @Column(name = "timestamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date timestamp;

    public Add() {
    }

    public Add(Integer addId) {
        this.addId = addId;
    }

    public Integer getAddId() {
        return addId;
    }

    public void setAddId(Integer addId) {
        this.addId = addId;
    }

    public String getAddText() {
        return addText;
    }

    public void setAddText(String addText) {
        this.addText = addText;
    }

    public String getAddLink() {
        return addLink;
    }

    public void setAddLink(String addLink) {
        this.addLink = addLink;
    }

    public Boolean getAddStatus() {
        return addStatus;
    }

    public void setAddStatus(Boolean addStatus) {
        this.addStatus = addStatus;
    }

    public Integer getHitCounter() {
        return hitCounter;
    }

    public void setHitCounter(Integer hitCounter) {
        this.hitCounter = hitCounter;
    }

    public Date getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Date timestamp) {
        this.timestamp = timestamp;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (addId != null ? addId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Add)) {
            return false;
        }
        Add other = (Add) object;
        if ((this.addId == null && other.addId != null) || (this.addId != null && !this.addId.equals(other.addId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.pojo.Add[addId=" + addId + "]";
    }

}
